<div class="actions index" style="margin: 0px;">
<h2><?php __('Access Control Objects');?></h2>

<?php e($form->create('Action', array('action'=>'index'))); ?>
<fieldset>
<ul id="ul_actions" class="controller">
<?php foreach($actions as $i=>$current_action_group):
    $all_actions = $current_action_group['actions']; ?>
    <li class="controller">
        <!-- Controller name -->
        <span class="name"><?php e($current_action_group['name']); ?></span>
        <!-- Controller actions list-->
        <ul id="ul_actions_<?php e($current_action_group['name']); ?>">
            <?php foreach($all_actions as $current_action): ?>
                <li>
                    <!-- Action name -->
                    <span class="action"><?php e($current_action['action']); ?></span>
                    <!-- Add or Delete -->
                    <span>
                    <?php if(isset($aco_list[$current_action['model']])): ?>
                        <?php e($form->input(
                            'Actions.SecurityAccess.'.$current_action['model_alias'],
                            array(
                                'label'=>sprintf('<span class="exclude">%s</span>', __('Exclude', true)),
                                'type'=>'checkbox',
                                //'class'=>'checkbox',
                                'value'=>'delete')
                        )); ?>
                    <?php else: ?>
                        <?php e($form->input(
                            'Actions.SecurityAccess.'.$current_action['model_alias'],
                            array(
                                'label'=>sprintf('<span class="include">%s</span>', __('Include', true)),
                                'type'=>'checkbox',
                                //'class'=>'checkbox',
                                'value'=>'include')
                        )); ?>
                    <?php endif; ?>
                    </span>
                </li>
            <?php endforeach; ?>
        </ul>
    </li>
    <?php if($i % 3 == 2): ?>
        <br class="clear"/>
    <?php endif; ?>
<?php endforeach; ?>
</ul>
<?php e($form->submit(__('Save Changes', true), array('class'=>'submit'))); ?>

</fieldset>
<?php e($form->end()); ?>

</div>
<?php //debug($actions); debug($aco_list); ?>
